$(window).ready(function(){
	//获取屏幕宽度
	var windowwidth=window.innerWidth;
	if(windowwidth<400){
		$('.system').css('width','100%');
	}else{
		$('.system').css('width','400px');
	}
	//获取屏幕高度
	var windowheight=window.innerHeight;
	//计算剩余高度
	var shengyuheight=windowheight-$('#header').height();
	$('.login').css('height',shengyuheight+'px');	
	//计算systemmargin
	var systemmargin=(shengyuheight-$('.system').innerHeight()-shengyuheight*0.1)/2;
	$('.system').css('margin',systemmargin+'px auto');	
	$('.left').load(function(){
		//计算leftmargin
		var leftmargin=(shengyuheight-$(".left").height())/2;
		$(".left").css('margin',leftmargin+'px auto');
	})
	$('.left').resize(function(){
		//计算leftmargin
		var leftmargin=(shengyuheight-$(".left").height())/2;
		$(".left").css('margin',leftmargin+'px auto');
	})
	$('.left').ready(function(){
		//计算leftmargin
		var leftmargin=(shengyuheight-$(".left").height())/2;
		$(".left").css('margin',leftmargin+'px auto');
	})
	$(window).resize(function(){
		//获取屏幕宽度
		var windowwidth=window.innerWidth;
		if(windowwidth<400){
			$('.system').css('width','100%');
		}else{
			$('.system').css('width','400px');
		}
		//获取屏幕高度
		var windowheight=window.innerHeight;
		//计算剩余高度
		var shengyuheight=windowheight-$('#header').height();
		$('.login').css('height',shengyuheight+'px');	
		//计算systemmargin
		var systemmargin=(shengyuheight-$('.system').innerHeight()-shengyuheight*0.1)/2;
		$('.system').css('margin',systemmargin+'px auto');
		$('.left').load(function(){
			//计算leftmargin
			var leftmargin=(shengyuheight-$(".left").height())/2;
			$(".left").css('margin',leftmargin+'px auto');
		})
		$('.left').resize(function(){
			//计算leftmargin
			var leftmargin=(shengyuheight-$(".left").height())/2;
			$(".left").css('margin',leftmargin+'px auto');
		})
		$('.left').ready(function(){
			//计算leftmargin
			var leftmargin=(shengyuheight-$(".left").height())/2;
			$(".left").css('margin',leftmargin+'px auto');
		})
	})
})
